from django.db import models


# Create your models here.
class Goods(models.Model):
    name = models.CharField(max_length=100, verbose_name="名称", blank=True, null=True)
    amount = models.IntegerField(verbose_name="数量(库存)", blank=True, null=True)
    price = models.FloatField(verbose_name="价格", blank=True, null=True)
    type = models.CharField(max_length=100, verbose_name="类型", blank=True, null=True)
    intro = models.CharField(max_length=100, verbose_name="简介", blank=True, null=True)
    desc = models.CharField(max_length=500, verbose_name="详情", blank=True, null=True)
    photo = models.ImageField(upload_to='images', verbose_name="商品图片", blank=True, null=True)
    unit = models.CharField(max_length=100, verbose_name="单位", blank=True, null=True)

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = '商品管理'
        verbose_name_plural = verbose_name
